<style>
#listingDelatnostiSettings{
	width:270px;
}
#listingDelatnostiSettings h3{
	margin-bottom:0px;
}
#listingDelatnostiSettings form{
	margin:0px;
	padding:0px;
}
#listingDelatnostiSettings label{
	display:block;
	float:left;
	clear:both;
	padding-top:8px;
	text-align:right;
}
#listingDelatnostiSettings select,
#listingDelatnostiSettings input[type=text],
#listingDelatnostiSettings textarea{
	width:200px;
}

#listingDelatnostiSettings #templateOpstine{
	display:none;
}
#listingDelatnostiSettings #listingSettingsKampanja{
	float:left;
	clear:both;
}
#listingDelatnostiSettings #listingSettingsKampanja #settingsData label{
	width:15px;
}
#listingDelatnostiSettings #listingSettingsKampanja input.del{
	width:18px;
	height:18px;
	background-image:url(gui/icons/delete.gif);
	background-repeat:no-repeat;
	background-position:center center;
	float:right;
}
#listingDelatnostiSettings #listingSettingsKampanja input.new{
	width:20px;
	height:20px;
	background-image:url(gui/icons/new.gif);
	background-repeat:no-repeat;
	background-position:center center;
	float:right;
}
#listingDelatnostiSettings #listingSettingsKampanja input[type=submit]{
	padding-left:18px;
	background-image:url(gui/icons/save.gif);
	background-repeat:no-repeat;
	background-position:3px center;
	float:right;
	clear:both;
}
#listingDelatnostiSettings .settingsItem{
	border:1px outset {{$ypgreyblue}};
	background:{{$ypgreyblue}};
	margin-top:5px;
	padding:7px;
	float:left;
	clear:both;
	width:100%;
}
#listingDelatnostiSettings #listingDelimiters input[type=text]{
	width:30px;
}
</style>
<div class="area" id="listingDelatnostiSettings">
	<h3>Opštine za listing u kampanji:</h3>
	<select name="templateOpstine" id="templateOpstine">
		{{%loop start opsid}}
		<option value="{{$opsid}}">{{$opsname}}</option>
		{{%loop end}}
	</select>
	<select name="kampanjaSettings" id="kampanjaSettings" onchange="closeYpAjaxForm();showListingSettings('{{$func}}',this.value);">
		{{%loop start kampanja_id}}
		<option value="{{$kampanja_id}}" {{$selected_kampanja}}>{{$kampanja_name}}</option>
		{{%loop end}}
	</select>
	
	
	<form method="post" id="listingSettingsKampanja" action="javascript:void(0)" onsubmit="submitForm(this,'komitenti.php','POST','afterSaveSettings('+document.getElementById('kampanjaSettings').value+');',1)">
		
		<div class="settingsItem">
			<input type="button" value="" class="new" onclick="newListingSetting()" />
			<h3>Opštine</h3>
			<input type="hidden" name="kampanja_id" value="{{$kamid}}" />
			<input type="hidden" name="a" value="listing" />
			<input type="hidden" name="mod" value="saveSettings" />
			
			<div id="settingsData">
				{{$comment_start}}
				{{%loop start item}}
					<span>
					<label for="opstina_{{$item}}">{{$item}}:</label>
					<select name="opstina_{{$item}}" id="opstina_{{$item}}">
						{{$opstina_options}}
					</select>
					<input class="del" type="button" value="" onclick="deleteListingSetting(this)" />
					</span>
				{{%loop end}}
				{{$comment_end}}
			</div>
		</div>
		{{$comment_start_advance}}
		<div id="listingDelimiters" class="settingsItem">
			<h3>Delimiter simboli</h3>
			<input type="text" name="delim1" value="{{$delim1}}" />
			<input type="text" name="delim2" value="{{$delim2}}" />
			<input type="text" name="delim3" value="{{$delim3}}" />
		</div>
		{{$comment_end_advance}}
		<input type="submit" value="sačuvaj" />
	</form>
</div>